package com.yuan.entity;


public class User {
    private String name;
    private Integer age;

    public User() {
        System.out.println("User对象被创建了");
    }

    @Override
    public String toString() {
        return "User{name='" + getName() + "',age=" + getAge() + "}";
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public void init() {
        System.out.println("对象被初始化");
    }

    public void destroy() {
        System.out.println("对象被销毁");
    }

}
